<template>
		<view class="wrapper">
			<scroll-view @scrolltolower="tolower" scroll-y :style="{height:windowH+'px'}">
				<nolist v-if="nolist" nolistTxt="暂无该分类的活动"></nolist>
				<view v-else class="cont">
					<view hover-class="bindhover"  @click="bindActivity(item.id)" class="lists" v-for="(item,index) in list" :key="index">
						<view class="flex_row allMsg">
							<image class="headPic" :src="item.avatarurl" mode="aspectFill"></image>
							<view class="flex_col Msg">
								<view class="userName flex_row">
									<view class="flex_row">
										<text>{{item.nickname}}</text>
										<image v-if="item.gender==1" src="../../static/image/man.png" mode="aspectFill"></image>
										<image v-else src="../../static/image/woman.png" mode="aspectFill"></image>
									</view>
									<view class="buy">{{item.h_money_item}}</view>
								</view>
								<view v-if="freeStyle==1" class="rang">{{item.juli_str}}</view>
								<view class="act flex_row">
									<view class="actMsg">
										<view class="actName">{{item.h_title}}</view>
										<view class="explain">{{item.h_profile}}</view>
										<view class="time">{{item.h_time_str}}</view>
									</view>
									<image :src="item.h_face_img" mode="aspectFill"></image>
								</view>
							</view>
						</view>
					</view>
					<load :loading="loading" :loadTxt="loadTxt"></load>
				</view>
			</scroll-view>
		</view>
</template>
<script>
	import common from "../common/network.js";
	import load from "./load.vue";
	import nolist from "./nolist.vue"
	export default {
		components:{load,nolist},
		name:"actList",
		props:{
			list:Array,
			titleText:{
				type:String,
				default:'',
			},
			loading:{
				default:false,
				type:Boolean,
			},
			loadTxt:{
				default:'正在加载...',
				type:String
			},
			windowH:{
				default:0,
				type:Number
			},
			nolist:{
				default:false,
				type:Boolean,
			},
		},
		data(){
			return{
				freeStyle:'',
			}
		},
		onLoad:function(){
			var that = this;
			uni.getStorage({
				key: 'free_style',
				success:function(res){
					that.freeStyle  = res.data;
				}
			})
		},
		methods:{
			bindActivity:function(id){
				this.$emit('bindActivity',id)
			},
			tolower:function(){
				this.$emit('tolower')
			}
		}
	}
</script>

<style scoped>
	.wrapper{
		/* border: 2px solid #FF3B2F; */
	}
	.lists{
		padding: 30px;
		border-bottom: 14px solid #FBFAFA;
	}
	.allMsg{
		align-items: flex-start;
	}
	.Msg{
		align-items: flex-start;
	}
	.headPic{
		border-radius: 50%;
		width: 94px;
		height: 94px;
		margin-right: 26px;
		min-width: 94px;
	}
	.buy{
		color: #E62A1F;
		font-size: 28px;
	}
	.userName{
		justify-content: space-between;
		width: 550px;
		/* padding-top: 20px; */
	}
	.userName text{
		color: #828282;
		font-size: 32px;
	}
	.userName image{
		width: 28px;
		height: 28px;
		margin-left: 16px;
	}
	.rang{
		font-size: 28px;
		color: #999;
		margin-top: 8px;
	}
	.act{
		width: 550px;
		justify-content: space-between;
		padding-top: 20px;
	}
	.actMsg{
		width: 400px;
	}
	.actMsg view{
		padding-bottom: 12px;
	}
	.actMsg .actName{
		font-size: 32px;
		font-weight: bold;
		padding-bottom: 10px;
	}
	.explain{
		width: 100%;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		color: #999;
		font-size: 28px;
	}
	.time{
		font-size: 28px;
	}
	.act image{
		width: 140px;
		height: 140px;
		border-radius: 4px;
	}
</style>
